-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix crash in PIF generation #9217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci test |
} | ||
} | ||
|
||
@Test func pluginWithBinaryTargetDependency() async throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Great to see more PIF tests in OSS SPM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @pmattos. We should expand the PIF test coverage.
Although this is a great test, it's a large
test (ie: end-to-end). Can we investigate writing tests lower in the test pyramid, possibly testing productRepresentingDependencyOfBuildPlugin
in isolation?
Fix a crash when unwrapping an optional 'mainModule' of a module. In the case where a plugin has a dependency on a 'binaryTarget' there is no main module. This only presents itself when you have defined the binaryTarget as both a product and target. * Update method that determines plugin dependencies to handle binaryTarget types explicitly. * Add a PIF generation test that captures this behavior.
fec6d4e
to
921daeb
Compare
Fixes #9067 |
@swift-ci test |
praise: Matthew just confirmed this fixes rdar://159087121 in Xcode too :) |
I've a PR up to validate this patch within Xcode... will report back the results :) |
@swift-ci test ci.swift.org was 504 for a while |
@swift-ci test |
@swift-ci test windows |
@swift-ci test windows self hosted |
#expect(executableTarget.common.name == "MyPluginExe") | ||
|
||
// Verify no errors were emitted during PIF generation | ||
let errors = observabilitySystem.diagnostics.filter { $0.severity == .error } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: do we expect warnings to occur? If no, should we also ensure no warnings exist? if the answer is "we don't care about warning", is there benefits adding a comment indicating so?
Looks a Swift Testing test was not terminated correctly
Re-triggering the build @swift-ci test self hosted windows |
All good in Xcode too 🚀 |
Based on Review. * Remove unwrapping and use the guarded mainModule variable.
@swift-ci test |
@swift-ci test windows |
@swift-ci test macOS |
Fix a crash when unwrapping an optional 'mainModule' of a module. In the case where a plugin has a dependency on a 'binaryTarget' there is no main module.
This only presents itself when you have defined the binaryTarget as both a product and target.